package cn.iocoder.yudao.module.pay.refund.mq;

import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.module.api.pay.refund.message.RefundFailureMessage;
import cn.iocoder.yudao.module.api.pay.refund.message.RefundSuccessMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 付退款单据 事件生产者
 *
 * @author 山野羡民（1032694760@qq.com）
 */
@Slf4j
@Component
public class RefundOrderProducer {

    public void sendRefundSuccessMessage(String refundNo) {
        log.info("[sendRefundSuccessMessage][refundNo({})]", refundNo);
        SpringUtil.getApplicationContext().publishEvent(new RefundSuccessMessage(refundNo));
    }

    public void sendRefundFailureMessage(String refundNo) {
        log.info("[sendRefundFailureMessage][refundNo({})]", refundNo);
        SpringUtil.getApplicationContext().publishEvent(new RefundFailureMessage(refundNo));
    }

}
